#include "VSMath.h"
#include "VSPlane3.h"
#include "VSLine3.h"
#include "VSTriangle3.h"
using namespace VSEngine2;
/*----------------------------------------------------------------*/
VSPlane3::VSPlane3()
{
	m_fD = 0.0f;
}
/*----------------------------------------------------------------*/
VSPlane3::VSPlane3(const VSVector3 &N , VSREAL fD)
{
	Set(N,fD);
}
/*----------------------------------------------------------------*/
VSPlane3::VSPlane3(const VSVector3 &N, const VSVector3 &P)
{
	Set(N,P);

}
/*----------------------------------------------------------------*/
VSPlane3::VSPlane3(const VSVector3 &P0,  const VSVector3 &P1, const VSVector3 &P2)
{
	Set(P0,P1,P2); 

}
/*----------------------------------------------------------------*/
VSPlane3::VSPlane3(const VSVector3 Point[3])
{
	Set(Point[0],Point[1],Point[2]);
}
/*----------------------------------------------------------------*/
void VSPlane3::Transform(const VSPlane3 &Plane,const VSMatrix3X3W &Mat)
{
	VSVector3 Point = Plane.GetPoint();
	m_N = Mat.ApplyNormal(Plane.m_N);
	
	VSVector3 NewPoint = Point * Mat;
	Set(m_N,NewPoint);
	

}

